<template>
  <div>
    <div class="da">
      <div class="juzhong">
        <span class="pospan" @click="text">x</span>
        <div>{{ title }}</div>
        <div>
          <slot name="ipt"><span>这是默认的内容</span></slot>
        </div>
        <div class="btn">
          <slot name="btn"></slot>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["title"],
  methods: {
    text() {
      this.$parent.isxianshi = false;
      // console.log(this.$parent);
    },
  },
};
</script>

<style scoped>
.da {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.juzhong {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
}

.pospan {
  position: absolute;
  right: 20px;
  cursor: pointer;
  top: 5px;
}

.btn {
  display: flex;
  justify-content: center;
}

.btn button {
  margin: 5px;
}
</style>
